#pragma once

// CChCConnect command target

class CChCConnect : public CAsyncSocket
{
public:	
	static CChCConnect* Instance();
	static BOOL Initialize(const CString& strUserName);
	static void Uninitialize();
	virtual ~CChCConnect();

	CString UserName() const { return m_strUserName; }
	void UserName(const CString& strVal) { m_strUserName = strVal; }

protected:
	/************************************************************************/
	/* CAsyncSocket                                                         */
	/************************************************************************/
	virtual void OnReceive(int nErrorCode);
	virtual void OnConnect(int nErrorCode);
	virtual void OnSend(int nErrorCode);


private:
	/************************************************************************/
	/* Single instance                                                      */
	/************************************************************************/
	CChCConnect();
	static CChCConnect* s_pInstance;

	/************************************************************************/
	/* Private variable                                                     */
	/************************************************************************/
	CString m_strUserName;
	BOOL m_bRun;

	//users list
	CList<CString> m_UsersArr;
};


